<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <!-- 用于移动端的视图缩放 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <link rel="stylesheet" th:href="@{/css/fontawesome.min.css}">
    <link th:include="commons::head">
</head>
<body>

<!-- 导航栏 -->
<!-- m-padded-tb-min my-padding-topAndBottom-min -->
<nav th:replace="commons::menu(1)"></nav>

<!-- Nav follow page -->
<div style="height: 70px"></div>

<!-- 中间内容 -->
<div id="waypoint" class="m-padded-tb-big m-container">
    <!-- container 能够根据响应式布局自动调整布局大小 -->
    <div class="ui container">
        <div class="ui grid stackable">
            <!-- 左边的博客部分 left Blogs content -->
            <div class="eleven wide column animate__animated animate__fadeInLeftBig">
                <!-- header -->
                <div class="ui top attached segment">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <h3 class="ui teal header">博客</h3>
                        </div>
                        <div class="right aligned column">
                            共 <h2 class="ui orange header m-inline-block m-text-thin" th:text="${page.totalElements}">
                            14 </h2> 篇
                        </div>
                    </div>
                </div>
                <!-- content -->
                <div class="ui attached segment js-toc-content">
                    <div class="ui segment" th:each="blog : ${page.content}">
                        <div class="ui padded vertical segment m-padded-tb-large">
                            <!-- mobile reversed （手机端显示时图片至上） stackable (手机端时堆叠放置) -->
                            <div class="ui grid mobile reversed stackable">
                                <div class="eleven wide column">
                                    <h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}"
                                                             class="m-black"
                                                             th:text="${blog.title}">你想要宝藏吗？那就快来大海上吧! </a>
                                    </h3>
                                    <p class="m-text" th:text="|${blog.description}...|">这是一件非常美好的事物</p>
                                    <div class="ui grid">
                                        <div class="eleven wide column">
                                            <div class="ui mini horizontal link list">
                                                <div class="item">
                                                    <img th:src="@{${blog.user.avatar}}" alt="头像"
                                                         class="ui avatar image">
                                                    <div class="content">
                                                        <a class="header" th:href="@{/about}"
                                                           th:text="${blog.user.nickname}" href="#">Lost
                                                            in timer</a>
                                                    </div>
                                                </div>
                                                <div class="item">
                                                    <i class="calendar icon"></i><span
                                                        th:text="${#dates.format(blog.updateTime, 'yyyy-MM-dd')}">2022-9-20</span>
                                                </div>
                                                <div class="item">
                                                    <i class="eye icon"></i>
                                                    <span th:class="m-margin-lr-tiny"
                                                          th:text="${blog.views}"> 2342
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="right aligned five wide column">
                                            <a href="#" th:href="@{/types/{id}(id=${blog.type.id})}"
                                               class="ui purple basic label m-padded-tiny" th:text="${blog.type.name}">
                                                认知升级
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="five wide column">
                                    <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                                        <img th:src="@{${blog.firstPicture}}" alt="文章展示图" class="ui rounded image">
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- footer -->
                <div class="ui bottom attached segment" th:if="${page.totalPages} > 1">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <a href="#" th:unless="${page.first}" th:href="@{/(page = ${page.number} - 1)}"
                               class="ui basic teal mini button">上一页</a>
                        </div>
                        <div class="right aligned column">
                            <a href="#" th:unless="${page.last}" th:href="@{/(page = ${page.number} + 1)}"
                               class="ui basic teal mini button">下一页</a>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 右边top区域 -->
            <div class="five wide column animate__animated animate__fadeInRightBig">
                <!-- 分类栏部分 -->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="idea icon"></i> 分类
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/types/-1}" target="_blank">more <i
                                        class="angle double right icon"></i></a>
                            </div>
                        </div>
                    </div>
                    <div class="ui segment teal">
                        <!-- fluid 填充剩余段落 -->
                        <div class="ui fluid vertical menu" th:each="type: ${types}">
                            <a class="item" th:href="@{/types/{id}(id=${type.id})}" href="#">
                                <span th:text="${type.name}">学习日志</span>
                                <!-- left pointing 在13小标签左侧加一个小三角 -->
                                <div class="ui teal basic label left pointing" th:text="${#arrays.length(type.blogs)}">
                                    13
                                </div>
                            </a>
                        </div>
                    </div>
                </div>
                <!-- 标签 -->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="tags icon"></i> 标签
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/tags/-1}" target="_blank">more <i
                                        class="angle double right icon"></i></a>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <a href="#" th:href="@{/tags/{id}(id=${tag.id})}" th:each="tag : ${tags}"
                           class="ui label tag m-margin-tb-tiny">
                            <span th:text="${tag.name}">方法论</span>
                            <div class="detail" th:text="${#arrays.length(tag.blogs)}">11</div>
                        </a>
                    </div>
                </div>
                <!-- 最新推荐 -->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment">
                        <i class="bookmark icon"></i> 最新推荐
                    </div>
                    <div class="ui segment" th:each="recommedBlog : ${recommendBlogs}">
                        <a href="#" th:href="@{/blog/{id}(id=${recommedBlog.id})}" target="_blank"
                           class="m-black m-text-thin" th:text="${recommedBlog.title}">用户故事~~</a>
                    </div>
                </div>
                <!-- 二维码 -->
                <div class="ui horizontal divider header m-margin-top-large">扫码关注我</div>
                <div class="ui centered card" style="width: 150px">
                    <img class="ui rounded image" src="http://cdn.cczjblog.top/cczjBlog-img/cczj_wechat.jpg" alt="二维码">
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 侧边提示栏 -->
<div id="toolbar" class="m-padded m-fixed m-right-bottom" style="display: none">
    <div class="ui vertical icon buttons">
        <button type="button" class="ui toc violet button">目录</button>
        <div id="toTop-button" class="ui icon button"><i class="chevron up icon"></i>顶部</div>
    </div>
</div>

<!-- 目录 -->
<div class="ui top-container flowing popup transition hidden" style="width: 250px !important;">
    <ol class="js-toc"></ol>
</div>
<div th:replace="commons::snow"></div>
<footer th:replace="commons::footer"></footer>
<!-- script_src -->
<!--/*/<th:block th:replace="commons::script">/*/-->
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script th:src="@{/js/semantic.min.js}"></script>
<!--/*/</th:block>/*/-->
<script>
    var script5 = document.createElement('script');
    script5.type = 'text/javascript';
    script5.src = '\\js\\autoload.js';

    $('body').append(script5);
</script>
</body>
</html>